{% extends 'base.html' %}

{% block title %}添加供应商 - 燃料结算系统{% endblock %}

{% block page_title %}添加供应商{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card">
            <div class="card-body">
                <form method="post" action="{{ url_for('suppliers.create') }}">
                    {{ form.hidden_tag() }}
                    <div class="row mb-3">
                        <div class="col-md-6">
                            {{ form.short_name.label(class="form-label") }}
                            {{ form.short_name(class="form-control") }}
                            {% for error in form.short_name.errors %}
                            <div class="text-danger">{{ error }}</div>
                            {% endfor %}
                        </div>
                        <div class="col-md-6">
                            {{ form.full_name.label(class="form-label") }}
                            {{ form.full_name(class="form-control") }}
                            {% for error in form.full_name.errors %}
                            <div class="text-danger">{{ error }}</div>
                            {% endfor %}
                        </div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-6">
                            {{ form.supplier_type.label(class="form-label") }}
                            {{ form.supplier_type(class="form-select") }}
                            {% for error in form.supplier_type.errors %}
                            <div class="text-danger">{{ error }}</div>
                            {% endfor %}
                        </div>
                        <div class="col-md-6">
                            {{ form.secondary_unit.label(class="form-label") }}
                            {{ form.secondary_unit(class="form-select") }}
                            {% for error in form.secondary_unit.errors %}
                            <div class="text-danger">{{ error }}</div>
                            {% endfor %}
                        </div>
                    </div>
                    <div class="d-flex justify-content-between">
                        <a href="{{ url_for('suppliers.index') }}" class="btn btn-outline-secondary">
                            <i class="bi bi-arrow-left me-2"></i>返回
                        </a>
                        {{ form.submit(class="btn btn-primary") }}
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %} 